Trallocator
A simple no_std
library for wrapping an existing allocator and tracking the heap usage.
Main usage is to keep track of the heap usage on embedded systems
Usage
Simply wrap an existing allocator with a Trallocator
.
Examples
With another allocator, here we use the system one
extern crate alloc;
extern crate std;
use Vec;
use System;
use Trallocator;
static ALLOCATOR: = new;
With the allocator API
extern crate alloc;
extern crate std;
use Vec;
use System;
use Trallocator;
let tralloc: = new;
assert_eq!;
let mut vec: = Vec new_in;
vec.reserve_exact;
assert_eq!;
License
Licensed under either of
-
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
-
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.